__author__="Kiana";
'''
python  基础练习
'''
#=======函数的定义========
def function_01():
    print("hello world");

#位置参数
def function_02(name,age):
    print(name,age)

#可变参数
def function_03(*args):
    print(args);

#可变关键字
def function_04(**kwargs):
    print(kwargs);

#命名关键字参数
def function_05(name,*,age):
    print(name,age);

#组合参数，定义函数的时候参数尽可能简单，尽可能不要使用组合参数

#函数的返回值
#函数单一返回值
def function_06():
    return "asdafaf";

#多返回值的情况
def function_07():
    return "fsdg",68,True

#空函数
def function_08():
    pass

#递归函数，自己调用自己，设置循环跳出的条件
def function_09(num):
    if num==1:
        return num;
    return num*function_09(num-1);

#==========类=========
class User(object):
    def __init__(self,user_name,password,email):
        self.user_name=user_name;
        self.password=password;
        self.email=email;
    def get_user_name(self):
        return self.user_name;

    def set_user_name(self,user_name):
        self.user_name = user_name;

    def login(self,user_name,password):
        pass;




if __name__=="__main__":
    function_01();
    function_02("kiana",20);
    function_03("kiana","20",None,"love");
    function_04(name="kiana",age=20);
    function_05("kiana",age=20);
    f=function_07();
    print(f);
    print(function_09(10))
    user=User("kiana","1207","love")
    print(user.user_name)
    print(user.__dict__);


